﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RBS.Common.JsonEntity;
using RBS.Core.BLL;
using RBS.Core.Model;
using RBS.Web.Hotel.Controllers;

namespace RBS.Web.Hotel.Areas.Chart.Controllers
{
    public class HotelChartController : BaseController
    {
        //
        // GET: /Chart/HotelChart/

        SpBll _spBll = new SpBll();
        public ActionResult Index()
        {
            return View();
        } 
        #region api
        #endregion
        public JsonResult GetHotelMain()
        { 
             var chart=new HotelChart();
            IList<object> list = new List<object>(); 
            for (int i = 7; i >=0; i--)
            {
                 var model = _spBll.GetThatDay(CurrentUser.HotelId, DateTime.Now.AddDays(-i));

              /*  var model=new ThatDay
                    {
                          PayTime='2012',
                         总收入 =1000;
                        积分收入 =1000;
                    }*/
                list.Add(model);
            }  
            chart.Rows = list;
            chart.RowCount = list.Count(); 
             return Json(chart, JsonRequestBehavior.AllowGet);
        }
    }
}
